home *** CD-ROM | disk | FTP | other *** search
- Path: news.monmouth.com!srkumar
- From: srkumar@shell.monmouth.com (Senthil Kumar)
- Newsgroups: comp.lang.c++
- Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
- Date: 26 Mar 1996 04:08:18 GMT
- Organization: Monmouth Internet Corporation
- Message-ID: <slrn4lerdj.2be.srkumar@shell.monmouth.com>
- References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu>
- NNTP-Posting-Host: shell.monmouth.com
- X-Newsreader: slrn (0.8.3)
-
- The way I look at exception handling (so far) is as a means of passing
- error messages (which cannot be ignored) from one layer of code to a
- higher layer of code, when possible errors cannot be resolved within
- the layer that does the throw.
-
- For eg. consider a function called fprintf, which takes a FILE *
- as its first argument. Now obviously, fprintf cannot do a damn thing
- with a NULL FILE *, and thus in this case it would be a good idea to
- throw an exception, telling the caller, "look, you better check this out."
-
- Am I on the right track? I would appreciate some comments, additional
- refinements etc.
-
- thanks,
- Senthil
-
-